package com.study.d015propertybind.jdk;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class Student {

		private int age;
		private String name;

		protected final PropertyChangeSupport  support = new PropertyChangeSupport(this);

		public Student(){
			this.name = name;
			this.age = age;
		}

		public int getAge() {
			return age;
		}

		public void setAge(int age) {
			int oldValue = this.age;
			this.age = age;
			support.firePropertyChange("proper_age", oldValue, this.age);
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			String oldValue = this.name;
			this.name = name;
			support.firePropertyChange("proper_name", oldValue, this.name);
		}

		public void addPropertyChangeListener(PropertyChangeListener listener){
			support.addPropertyChangeListener(listener);
		}
		public void removePropertyChangerListener(PropertyChangeListener listener){
			support.removePropertyChangeListener(listener);
		}

}
